Global Index
HTML5 JS API Index > ECMAScript Tutorials & Specs

Date

See 15.9.2.

Constructor
Date()
Date(int year, int month, optional int date, optional int hours, optional int minutes, optional int seconds, optional int ms)
Operations
static Date
now()
The now function return a Number value that is the time value designating the UTC date and time of the occurrence of the call to now.
static Date
UTC(int year, int month, optional int date, optional int hours, optional int minutes, optional int seconds, optional int ms)
When the UTC function is called with fewer than two arguments, the behaviour is implementation-dependent. When the UTC function is called with two to seven arguments, it computes the date from year, month and (optionally) date, hours, minutes, seconds and ms.
numbergetDate()
intgetDay()
intgetFullYear()
intgetHours()
intgetMilliseconds()
intgetMinutes()
intgetMonth()
intgetSeconds()
numbergetTime()
int
getTimezoneOffset()
Returns the difference between local time and UTC time in minutes.
numbergetUTCDate()
intgetUTCDay()
intgetUTCFullYear()
intgetUTCHours()
intgetUTCMilliseconds()
intgetUTCMinutes()
intgetUTCMonth()
intgetUTCSeconds()
numbersetDate(int date)
number
setFullYear(int year, optional int month, optional int date)
If month is not specified, this behaves as if month were specified with the value getMonth().
number
setHours(int hour, optional int min, optional int sec, optional int ms)
If min is not specified, this behaves as if min were specified with the value getMinutes().
numbersetMilliseconds(int ms)
number
setMinutes(int min, optional int sec, optional int ms)
If sec is not specified, this behaves as if sec were specified with the value getSeconds().
number
setMonth(int month, optional int date)
If date is not specified, this behaves as if date were specified with the value getDate().
number
setSeconds(int sec, optional int ms)
If ms is not specified, this behaves as if ms were specified with the value getMilliseconds().
numbersetTime(number time)
numbersetUTCDate(int date)
number
setUTCFullYear(int year, optional int month, optional int date)
If month is not specified, this behaves as if month were specified with the value getUTCMonth().
number
setUTCHours(int hour, optional int min, optional int sec, optional int ms)
If min is not specified, this behaves as if min were specified with the value getUTCMinutes().
numbersetUTCMilliseconds(int ms)
number
setUTCMinutes(int min, optional int sec, optional int ms)
If sec is not specified, this behaves as if sec were specified with the value getUTCSeconds().
number
setUTCMonth(int month, optional int date)
If date is not specified, this behaves as if date were specified with the value getUTCDate().
number
setUTCSeconds(int sec, optional int ms)
If ms is not specified, this behaves as if ms were specified with the value getUTCMilliseconds().
string
toDateString()
This function returns a String value. The contents of the String are implementation-dependent, but are intended to represent the “date” portion of the Date in the current time zone in a convenient, human-readable form.
string
toISOString()
This function returns a String value represent the instance in time represented by this Date object. The format of the String is the Date Time string format defined in 15.9.1.15. All fields are present in the String. The time zone is always UTC, denoted by the suffix Z.
string
toJSON(any key)
This function provides a String representation of a Date object for use by JSON.stringify (15.12.3).
string
toLocaleDateString()
This function returns a String value. The contents of the String are implementation-dependent, but are intended to represent the “date” portion of the Date in the current time zone in a convenient, human-readable form that corresponds to the conventions of the host environment’s current locale.
string
toLocaleString()
This function returns a String value. The contents of the String are implementation-dependent, but are intended to represent the Date in the current time zone in a convenient, human-readable form that corresponds to the conventions of the host environment’s current locale.
string
toLocaleTimeString()
This function returns a String value. The contents of the String are implementation-dependent, but are intended to represent the “time” portion of the Date in the current time zone in a convenient, human-readable form that corresponds to the conventions of the host environment’s current locale.
string
toString()
This function returns a String value. The contents of the String are implementation-dependent, but are intended to represent the Date in the current time zone in a convenient, human-readable form.
string
toTimeString()
This function returns a String value. The contents of the String are implementation-dependent, but are intended to represent the “time” portion of the Date in the current time zone in a convenient, human-readable form.
string
toUTCString()
This function returns a String value. The contents of the String are implementation-dependent, but are intended to represent the Date in a convenient, human-readable form in UTC.
number
valueOf()
The valueOf function returns a Number, which is this time value.
Referenced by
FilelastModifiedDate
HTMLInputElementvalueAsDate
HTMLMediaElementgetStartDate()